package com.nuoniu.sibanyun.mapper.erp.barcode;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.erp.barcode.ErpNsInOutMain;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * ERP非标 出入库主表 Mapper 接口
 * </p>
 *
 * @author 白强
 * @since 2021-11-30
 */
public interface ErpNsInOutMainMapper extends BaseMapper<ErpNsInOutMain> {

    @Select("select voucher_code from erp_ns_in_out_main where company_id=#{companyId} and date_format(now(), #{dateStr})=date_format(create_date, #{dateStr}) AND data_source = #{dataSource} order by create_date desc limit 1")
    String getCode(Integer companyId,  String dateStr, String dataSource);

}
